Encryption is the process of converting a message from plaintext to ciphertext in such a way that only those that are authorized readers can decrypt the plaintext from the ciphertext. Often, encryption is used to secure a message that is expected to be transported through an untrusted channel or stored on an insecure data storage medium. The term “message” often refers to a communication between a sender and a receiver but as used here the term refers to any data that might need to be secured between the time and/or place of its creation or acceptance by the sender and the time and/or place of its receipt by the receiver. Thus, a message could be an e-mail communication, a program, a dataset, an image, a collection of data objects treated as a single message, a stream of data, or combinations of the above or similar objects.
One method of determining whether or not the receiver is authorized to read, or otherwise access, the plaintext of the message is the use of “keys”. Typically a key is representable by data, such as a string of bits. An example is a 128-bit key, which is a string of 128 bits. Using this method, the sender would use an encryptor to encrypt the plaintext of the message into the ciphertext in such a way that any recipient of the ciphertext, authorized or not, that did not have knowledge of the key could not decrypt the plaintext from the ciphertext without some threshold of computing effort and/or time.
It is well understood that, except for a limited class of encryption schemes such as using one time pads, the plaintext can be extracted from the ciphertext without the key with enough computing effort and/or time. For example, an attacker (i.e., an unauthorized recipient) could attempt to decrypt the message by serially decrypting using each possible key. However, in a well-designed encryption system, the amount of computing effort needed to decrypt without the key costs more than the value of having decrypted the message or would take so much time that the value of keeping the message secure has passed before the message is decrypted.
There are several aspects of message security that an encryption system provides. One aspect is secrecy, in that the plaintext of a message can be kept from unauthorized readers even if the reader has possession of the ciphertext of the message. Another aspect is authentication, in that the recipient of the ciphertext can verify that the message was actually sent by the purported sender. Yet another aspect is integrity, in that the recipient can verify that the message was not modified after leaving the control of the sender. In some instances, only one aspect is used. For example, a digital signature process creates a data sequence that authenticates a message and that message is often sent “in the clear” so that anyone can read the message. Thus, the message is not kept secret, but it can still be authenticated. Although a system does not always encrypt a message before transport or storage, as is the case for digital signatures, the system is nonetheless generically referred to as an encryption system.
Encryption systems are often classified into private key systems and public key systems, often referred to as symmetric key systems and asymmetric key systems, respectively. In a private key system, the key is used by the sender to encrypt the message and the same key is used by the receiver to decrypt or verify the message. As a result, the key must be kept secret from unauthorized entities. With public key systems, the key is a pair of key parts comprising a public part and a private part. The public part is not necessarily kept secret and can be used to verify messages and perform other processes on a message, but typically the private key is needed to extract plaintext from the ciphertext of a secret message.
One example of a public key standard is the widely used RSA standard. One advantage of using a standard public key system is that many components of the system are readily available, such as e-mail encryptors, key managers, encoders, decoders, verifiers, and the like. However, a problem with many standard encryption systems is that they operate on the message in blocks of fixed sizes per key length, requiring padding when the message to be sent does not fill an integer number of blocks exactly. Random data should be used for padding, to avoid easy attacks on decrypting the message without the key.
The use of fixed size blocks is not a problem where messages are always sized to be an integer number of blocks, but where the messages are not an integer number of blocks, but instead comprise zero or more full blocks and a partial block, the partial block must be padded up to a whole block before processing. Where the amount of processing to encrypt, decrypt or verify a message is a function of the number of blocks and the amount of processing needed for a block is considerable, a processing routine might perform many unnecessary operations on a partial block if the message portion of the partial block is much smaller than the block size.
For example, the block size is often dictated by a key modulus used to encrypt a block. If the key modulus is 512 bits, messages will be encoded in 512 bit blocks. If a message to be encrypted happens to be 1025 bits long, the message would be encrypted into three 512-bit blocks, one of which would represent only one bit of the message.